import datetime
from mongodb_manager import *

connection = MongoDBManager().get_connection()

@connection.register
class Node(Document):
    __collection__ = 'nodes'
    __database__ = 'filetree'
    structure = {
        'setid':unicode,
        'path':unicode,
        'filename':unicode,
        'is_symlink':bool,
        'date_updated':datetime.datetime,
        'timestamp':int,
        'md5':basestring,
    }
    required_fields = ['filename', 'path', 'date_updated']
    indexes = [
        {
            'fields':['path','filename','setid', 'md5'],
            'unique':True,
        },
    ]
    use_dot_notation = True

if __name__ == '__main__':
    pass
